//
//  MerchantsBrandViewController.m
//  消费100
//
//  Created by eliot on 16/4/1.
//  Copyright © 2016年 aleven. All rights reserved.
//

#import "MerchantsBrandViewController.h"

@interface MerchantsBrandViewController ()

@property (weak, nonatomic) IBOutlet UILabel *descLb;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *descLbH;

@property (weak, nonatomic) IBOutlet UILabel *nameLb;


@property (weak, nonatomic) IBOutlet UIImageView *iconIV;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *iconIVW;


@property (weak, nonatomic) IBOutlet NSLayoutConstraint *iconIVH;


@end

@implementation MerchantsBrandViewController

+(MerchantsBrandViewController*)CreatMerchantsBrandViewController{
    
    UIStoryboard *story=[UIStoryboard storyboardWithName:@"Main" bundle:nil];
    MerchantsBrandViewController *MerchantsBrandViewController=[story instantiateViewControllerWithIdentifier:@"MerchantsBrandViewController"];
    return MerchantsBrandViewController;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"商家品牌";
    
    self.iconIVH.constant = 129.0 / 320 *Width;
    self.iconIVW.constant = 304.0 / 320 *Width;
    
    /** 设置导航啦样式*/
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:19],NSForegroundColorAttributeName:[UIColor whiteColor]}];
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
    self.navigationController.navigationBar.translucent = NO;
    self.descLb.textColor = [UIColor colorWithRed:86/255.0 green:86/255.0 blue:86/255.0 alpha:1];
    self.nameLb.textColor = [UIColor colorWithRed:86/255.0 green:86/255.0 blue:86/255.0 alpha:1];
    
    
    /**         在此之前设置描述内容   */
    UIFont *font = [UIFont fontWithName:@"Arial" size:14];
    CGSize maxSize = CGSizeMake(Width - 16, CGFLOAT_MAX);
    NSStringDrawingOptions opts = NSStringDrawingUsesLineFragmentOrigin |
    NSStringDrawingUsesFontLeading;
    NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
    [style setLineBreakMode:NSLineBreakByCharWrapping];
    
    NSDictionary *attributes = @{ NSFontAttributeName : font, NSParagraphStyleAttributeName : style };
    CGRect rect1 = [self.descLb.text boundingRectWithSize:maxSize
                                               options:opts
                                            attributes:attributes
                                               context:nil];
    self.descLbH.constant = rect1.size.height;
    

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
